import { createRouter, createWebHistory } from 'vue-router'
import My from '@/views/home/my.vue'
import Cart from '@/views/home/cart.vue'
import Cla from '@/views/home/cla.vue'
import Index from '@/views/home/index.vue'
import Home from '@/views/home/home.vue'
import reg from '@/views/reg/index.vue'
import login from '@/views/login/index.vue'
import yzm from '@/views/yzm/index.vue'
import lb from '@/views/lb/index.vue'
import xq from '@/views/xq/index.vue'
import dd from '@/views/dd/index.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      component: Home, children: [
        {
          path: 'index',
          component: Index,
        },
        {
          path: 'cla',
          component: Cla,
        },
        {
          path: 'cart',
          component: Cart,
        },
        {
          path: 'my',
          component: My,
        },
      ]
    },
    {
      path: '/reg',
      component: reg,
    },
    {
      path: '/login',
      component: login,
    },
    {
      path: '/yzm',
      component: yzm,
    },
    {
      path: '/lb/:cat_name',
      component: lb,
    },
    {
      path: '/xq/:goods_id',
      component: xq,
    },
    {
      path: '/dd',
      component: dd,
    },
  ],
})

export default router
